Hoare Logic for Realistically Modelled Machine Code
نویسندگان
چکیده
This paper presents a mechanised Hoare-style programming logic framework for assembly level programs. The framework has been designed to fit on top of operational semantics of realistically modelled machine code. Many ad hoc restrictions and features present in real machine-code are handled, including finite memory, data and code in the same memory space, the behavior of status registers and hazards of corrupting special purpose registers (e.g. the program counter, procedure return register and stack pointer). Despite accurately modeling such low level details, the approach yields concise specifications for machinecode programs without using common simplifying assumptions (like an unbounded state space). The framework is based on a flexible state representation in which functional and resource usage specifications are written in a style inspired by separation logic. The presented work has been formalised in higher-order logic, mechanised in the HOL4 system and is currently being used to verify ARM machine-code implementations of arithmetic and cryptographic operations.
منابع مشابه
Formal verification of machine-code programs
Formal program verification provides mathematical means of increasing assurance for the correctness of software. Most approaches to program verification are either fully automatic and prove only weak properties, or alternatively are manual and labour intensive to apply; few target realistically modelled machine code. The work presented in this dissertation aims to ease the effort required in pr...
متن کاملDecompilation into logic - Improved
This paper presents improvements to a technique which aids verification of machine-code programs. This technique, called decompilation into logic, allows the verifier to only deal with tractable extracted models of the machine code rather than the concrete code itself. Our improvements make decompilation simpler, faster and more generally applicable. In particular, the new technique allows the ...
متن کاملAUSPICE: Automatic Safety Property Verification for Unmodified Executables
Verification of machine-code programs using program logic has focused on functional correctness, and proofs have required manuallyprovided program specifications. Fortunately, the verification of shallow safety properties such as memory and control-flow safety can be easier to automate, but past techniques for automatically verifying machine-code safety have required post-compilation transforma...
متن کاملA Compositional Logic for Control Flow and its Application in Foundational Proof-Carrying Code
Proof-Carrying Code (PCC) is a static mechanism that mechanically verifies safety of machine-language programs. But the problem in conventional PCC is, who will verify the verifier (the type checker) itself? The Foundational Proof-Carrying Code (FPCC) project at Princeton verifies the soundness of the type checker from the smallest possible set of axioms — logic plus machine semantics. One chal...
متن کاملProgram Compilation 1. Machine Language Syntax
Overview This chapter describes the syntax and semantics of the SAFE machine language and the compilation of SAFE programs into the machine language, and discusses the correctness of a compilation algorithm. The syntax, semantics and compilation have all been formally embedded in the HOL theorem proving system, and the compilation veriied correct w.r.t. the semantics of SAFE given in the previo...
متن کامل